﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

//SpriteSources create sprites for MapObjects
//A SpriteSource should only return sprite instances for specific ObjectNames that it supports

namespace TTEngine
{
    public abstract class SpriteSource
    {
        //constructor
        public SpriteSource()
        {
            SpriteFactory.InstallSpriteSource(this);
        }

        //Only the SpriteSources that comes in the basic TT package should return true, custom SpriteSources should return falsre
        public virtual bool IsPrimarySource
        {
            get
            {
                return false;
            }
        }

        //return a sprite instance for a MapObject, or a null if one could not be created
        public abstract object CreateSprite(MapObject mo);

        //return a sprite instance as the Primary SpriteSource, will only be called if "IsPrimarySource" returned true
        public abstract object CreateSpriteAsPrimarySource(MapObject mo);
    }
}
